/*** 
 * @Author: Suchen.Ma
 * @Date: 2024-06-29 00:18:15
 * @LastEditTime: 2024-07-27 18:03:47
 * @LastEditors: Suchen.Ma
 * @Description: 
 * @FilePath: \FW\User\drivers\tm1818.h
 */
/***
 * @Author: Suchen.Ma
 * @Date: 2024-06-29 00:18:15
 * @LastEditTime: 2024-07-01 23:53:25
 * @LastEditors: Suchen.Ma
 * @Description:
 * @FilePath: \FW\User\drivers\tm1818.h
 */
#ifndef __TM_1818_H__
#define __TM_1818_H__

#ifdef __cplusplus
extern "C"
{
#endif

#include "stm32f1xx_hal.h"
#include <string.h>
#include "cmsis_os.h"
#include <stdbool.h>



    typedef struct
    {
        GPIO_TypeDef *GPIOx;
        uint16_t GPIO_Pin;
    } LO_EN_port_pin, LIGH_EN_port_pin;

#define LIGH_ENPort(x) VLED##x##_GPIO_Port
#define LIGH_ENPin(x) VLED##x##_Pin

#define Vled_ENPortPin(x)               \
    {                                   \
        LIGH_ENPort(x), LIGH_ENPin(x)   \
    }
void DelayUs(uint32_t nUs);
    int write_data_effect(unsigned int data);
    int write_data_effect_L2R(unsigned int data);
    
void vled_ctrl(int index, bool sta);
#ifdef __cplusplus
}
#endif

#endif /* __KEY_PAD_H__ */
